import json
import requests


def __query_json__():
    # URL 地址
    url = 'http://10.10.80.215:7501/eoms/complaintPersonal/getComplainShareInfo'

    data = {
        'beans': [
            {
                'KEY': {
                }
            }
        ],
        'object': {
        },
        'params': {
            'wrkfmShowSwftno': '20240828185440X481217012',
            'provCode': '',
            'tenantId': '',
            'sysCode': '',
            'apiVersion': ''
        }
    }

    # 发送 POST 请求
    response = requests.post(url, json=data)

    # 打印响应的内容
    if response.status_code == 200:
        response_data = json.loads(response.text)
        # 格式化JSON输出
        formatted_response_data = json.dumps(response_data, indent=4, ensure_ascii=False)
        # 将响应结果写入新文件
        # with open('/gs/data/response/事件/response.json', 'w',
        #           encoding='utf-8') as outfile:
        #     outfile.write(formatted_response_data)
        print(formatted_response_data)
    else:
        print(f'请求失败，状态码：{response.status_code}')



def __query_json2__():
    # URL 地址
    url = 'http://10.10.80.215:7135/api/v2/complaint/getReminderContent?insProcId=6706&type=M'


    # 发送 POST 请求
    response = requests.get(url)

    # 打印响应的内容
    if response.status_code == 200:
        response_data = json.loads(response.text)
        # 格式化JSON输出
        formatted_response_data = json.dumps(response_data, indent=4, ensure_ascii=False)
        # 将响应结果写入新文件
        # with open('/gs/data/response/事件/response.json', 'w',
        #           encoding='utf-8') as outfile:
        #     outfile.write(formatted_response_data)
        print(formatted_response_data)
    else:
        print(f'请求失败，状态码：{response.status_code}')


if __name__ == '__main__':
    # __query_json__()
    __query_json2__()